//
// Created by superadmin on 14-5-7.
// Copyright (c) 2014 IDongler. All rights reserved.
//


#import <Foundation/Foundation.h>
#import "ApiResponse.h"
#import "ApiRequest.h"
#import "AFChengShangApiInvoker.h"

@interface ApiInvoker : NSObject
@property(nonatomic, strong) NSString *apiBaseUrl;
@property (nonatomic, assign) NSUInteger timeoutInSeconds; /*请求超时秒数，默认为10s*/
@property (nonatomic, strong) NSString *signToken;//签名Token

- (void)postApi:(NSString *)api andRequest:(ApiRequest *)apiRequest callback:(API_CALLBACK)callback;

//请求API
- (void)requestApi:(NSString *)api WithMethod:(NSString *)httpMethod andRequest:(ApiRequest *)apiRequest callback:(API_CALLBACK)callback;
//公共的处理错误信息
- (void)handleError:(NSInteger)statusCode response:(ApiResponse *)apiResponse;
- (NSString *) md5:(NSString *) input;
@end